function P=s_ode(G,P,k)
% s_ode: An example subroutine to step a player with the so-called "ODE motion"
%
% SYNTAX:
%   P = s_ode(G,P,k)
%   Return the player object with updated position (P.pos) ,angle (P.ang) and states (P.Vars).
%   The underlying ODE (ordinary differential equations) to update P.Vars should be specified by P.ode_func.
%   User routine specified by P.ode_func should following the calling syntax of example routine in def_ode_func.m


%   Author: Hongbin Ma
%   Last updated: 2009-6-2 with MATLAB 6.5
%   Problems or suggestions? Email me: mathmhb[at]163.com

tspan=[G.t,G.t+G.h];
y0=P.Vars;
[t,y]=ode23(P.ode_func,tspan,y0,[],G,P,k);
P.trace=y;
P.Vars=y(end,:);
P=feval(P.calc_pos_ang_func,G,P,k);
